package com.etc.controller;

import com.etc.core.CodeMessage;
import com.etc.dao.UerInfomstMapper;
import com.etc.pojo.CustomPo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;

@RestController
public class HelloController {

    @Autowired
    UerInfomstMapper mapper;

    @GetMapping("hello.action")
    public CodeMessage hello() {
        System.out.println(11);

        System.out.println("2");
//        param.forEach((k, v) -> {
//            System.out.println(k + "@" + v);
//        });

        List<CustomPo> plist = mapper.findByNameCutomer("mazheng");
        CodeMessage cm = new CodeMessage();
        cm.setCode("200");
        cm.setMessage("hello spring boot");

//        HashMap m = new HashMap();
//        m.put("ename", "tom");
//        m.put("age", 100);
//
//        m.put("list", new int[]{1, 3, 5, 7, 9});
        cm.setData(plist);

        return cm;
    }
}
